﻿using System.Collections.Generic;
using Red.Core;

namespace Red.Controls
{
    public static class WorldEditorCommands
    {
        public static RedCommand Load = new RedCommand( "Load", "appbar_box" );
        public static RedCommand Unload = new RedCommand( "Unload", "appbar_box" );
        public static RedCommand LoadAll = new RedCommand( "Load all", "appbar_box" );
        public static RedCommand UnloadAll = new RedCommand( "Unload all", "appbar_box" );
        public static RedCommand SaveAll = new RedCommand("Save all", "appbar_box");
        public static RedCommand CloseAll = new RedCommand("Close all", "appbar_box");
        public static RedCommand Remove = new RedCommand( "Remove", "appbar_box" );
        public static RedCommand ToggleVisibility = new RedCommand( "Toggle visibility", "appbar_box" );

        public static RedCommand AddLayer = new RedCommand("Add layer...", "appbar_box");
        public static RedCommand AddSector = new RedCommand("Add sector...", "appbar_box");
        public static RedCommand AddArea = new RedCommand("Add area...", "appbar_box");

        public static RedCommand OpenArea = new RedCommand("Open for edit", "appbar_box");
        public static RedCommand CloseArea = new RedCommand("Close edition", "appbar_box");

        public static IEnumerable< RedCommand > SectorItemCommands  { get; private set; }
        public static IEnumerable<RedCommand> AreaItemCommands { get; private set; }
        public static IEnumerable<RedCommand> WorldItemCommands { get; private set; }
        public static IEnumerable< RedCommand > LayerItemCommands { get; private set; }
        public static IEnumerable< RedCommand > NodeItemCommands { get; private set; }

        static WorldEditorCommands()
        {
            SectorItemCommands = new List<RedCommand>()
            {
                Load,
                Unload,
                LoadAll,
                UnloadAll,
                AddLayer,
                AddSector,
                Remove
            };

            LayerItemCommands = new List<RedCommand>()
            {
                ToggleVisibility,
                Remove
            };

            AreaItemCommands = new List<RedCommand>()
            {
                OpenArea,
                CloseArea,
                SaveAll,
                LoadAll,
                UnloadAll,
            };

            NodeItemCommands = new List<RedCommand>()
            {
                ToggleVisibility
            };

            WorldItemCommands = new List<RedCommand>()
            {
                AddArea,
                SaveAll,
                CloseAll,
            };
        }
    }
}
